package com.rose.doorto.footbathdoor.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rose.doorto.footbathdoor.mapper.QueueMessagesMapper;
import com.rose.doorto.footbathdoor.pojo.QueueMessages;
import com.rose.doorto.footbathdoor.service.QueueMessagesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
 * @Author 李庆超
 * @email 1481791489@qq.com
 * @Package：com.rose.doorto.footbathdoor.service.impl
 * @Project：door-to-door
 * @name：QueueMessagesServiceImpl
 * @date 2024/09/03 2024/9/3:17:06:
 */
@Service
@Transactional
public class QueueMessagesServiceImpl extends ServiceImpl<QueueMessagesMapper, QueueMessages> implements QueueMessagesService {

    @Autowired
    private QueueMessagesMapper queueMessagesMapper;

    /**
     * 修改消息状态
     * @param messageId
     * @param status
     * @return
     */
    @Override
    public int updateStatusByMessageId(String messageId, Integer status) {
        return queueMessagesMapper.updateStatusByMessageId(messageId,status);
    }

    /**
     * 更新消息的重发次数
     * @param messageId
     * @return
     */
    @Override
    public int updateCountByMessageId(String messageId) {
        return queueMessagesMapper.updateCountByMessageId(messageId);
    }
}
